/* Get rid of the old user if they are there */
PRINT ''
use [[[Database_Name]]]
GO

PRINT ''
PRINT 'Setting up defaut [[Database_Name]] user and login'
if USER_ID('[[Database_User]]') is not null
    exec sp_dropuser '[[Database_User]]'
GO

if exists ( select * from master.dbo.syslogins where loginname = '[[Database_User]]' )
    exec sp_droplogin '[[Database_User]]'
GO

/* Re-add the user */
exec sp_addlogin '[[Database_User]]','[[Database_Password]]', '[[Database_Name]]'
GO

exec sp_grantdbaccess '[[Database_User]]'
GO

exec sp_addrolemember 'db_owner', '[[Database_User]]'
GO 